<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位</title>
    <style>
        .box{
            background-color:red;
            width:100px;
            height:100px;
            /*相对定位*/
            position:relative;
            /*设置偏移*/
            margin-left:20px;
            top:100px;
            left:100px;
        }
    </style>
</head>
<body>
<div class="box"></div>
</body>
</html>